﻿
@{

    ViewData["Title"] = "Edit";

}

<h1>Edit</h1>

<div class="table">
    <form id="edituser">
        <table>
            <tr>
                <td>ID</td>
                <td>
                    @Model.Id
                    <input name="Id" type="hidden" value="@Model.Id" />
                </td>
            </tr>
            <tr>
                <td>Name</td>
                <td><input name="Name" type="text" value="@Model.Name" /></td>
            </tr>
            <tr>
                <td>Moblie</td>
                <td><input name="Moblie" type="text" value="@Model.Moblie" /></td>
            </tr>
            <tr>
                <td>Pwd</td>
                <td><input name="Pwd" type="text" value="@Model.Pwd" /></td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="button" id="btn" value="Submit">
                </td>
            </tr>
        </table>
    </form>
</div>
<script>
    $(function () {
        $("#btn").click(function () {
            var data = $("#edituser").serialize();
            $.post("/Home/EditUser",  data , function (res) {
                if (res.isok) {
                    location.href = "/Home/Index";
                }
            })
        });
       
    })
</script>
